package com.yuan.yblog.search.config;

import com.yuan.yblog.search.asyn.AsyncFactory;
import com.yuan.yblog.search.asyn.AsyncManager;
import jakarta.annotation.PostConstruct;
import org.springframework.stereotype.Component;

/**
 * @author hepeiyuan on 2024/5/31 15:06
 * @description 项目启动初始化类
 */
@Component
public class Initializer {
    /**
     * 项目启动
     */
    @PostConstruct
    public void init() {
        // mysql.post 全量导入 ES
        AsyncManager.me().execute(AsyncFactory.esImportPost());
        // 开启监听canal
        AsyncManager.me().createdThread(AsyncFactory.canalListen());
    }
}
